function [ output ] = votingFunction( classifiers_output )
    [classify_size, number_of_classifiers] = size(classifiers_output);
    output = zeros(classify_size, 1);
    
    votingMechanism(1, classify_size) = struct('voteForDiamond',[], 'voteForLine', [], 'voteForEllipse', []);
    % initialize structure with zero values
    for i = 1 : classify_size
        votingMechanism(1, i).voteForDiamond = 0;
        votingMechanism(1, i).voteForLine = 0;
        votingMechanism(1, i).voteForEllipse = 0;
    end
    
    % loop on all of the classifiers output and calculate the number of
    % iterations a classifier classifies an image as a certain type
    for i = 1 : number_of_classifiers
        for j = 1 : classify_size
            if classifiers_output(j, i) == 1
                votingMechanism(1, j).voteForLine = votingMechanism(1, j).voteForLine + 1;
            elseif classifiers_output(j, i) == 2
                votingMechanism(1, j).voteForDiamond = votingMechanism(1, j).voteForDiamond + 1;
            elseif classifiers_output(j, i) == 3
                votingMechanism(1, j).voteForEllipse = votingMechanism(1, j).voteForEllipse + 1;
            end % end if
        end % end for
    end % end for
    
    % vote for the best number of occurances in the structure
    for i = 1 : classify_size
        maximum_number = max([votingMechanism(1, i).voteForLine votingMechanism(1, i).voteForDiamond votingMechanism(1, i).voteForEllipse]);
        if votingMechanism(1, i).voteForLine == maximum_number
            output(i ,1) = 1;
            continue;
        elseif votingMechanism(1, i).voteForDiamond == maximum_number
            output(i ,1) = 2;
            continue;
        elseif votingMechanism(1, i).voteForEllipse == maximum_number
            output(i ,1) = 3;
            continue;
        end % end if
    end % end for  
end

